<?php
namespace app\admin\model;

use think\Model;
use think\Db;
                    

class DemandOptions extends Model
{
    public function xlDb(){
        return Db::connect('mysql://xinglong:Aa515589163@180.76.104.227:3306/xinglong#utf8');
    }

                    
    public function getOne($where){
                    
        $rs = DemandOptions::where($where)
                    
        ->find();
                    
        return $rs;
                    
    }
                    
    public function add($data){
                    
        $rs = DemandOptions::data($data)
                    
        ->save();
                    
        return $rs;
                    
    }
                    
    public function edit($where,$data){
                    
        $rs = DemandOptions::where($where)
                    
        ->update($data);
                    
        return $rs;
                    
    }
                    
    public function del($where){
                    
        $rs = DemandOptions::where($where)
                    
        ->delete();
                    
        return $rs;
                    
    }

    public function getCity(){
        return $this->xlDb()->table('xinglong_citys')->where('pid','0')->select();
    }
                    
}
                    
